const { resolve } = require('path');

module.exports = {
  entry: './main.js',
  mode: 'development',
  // mode: 'production',
  output: {
    path: resolve(__dirname, 'dist')
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env'],
            plugins: [['@babel/plugin-transform-react-jsx', {pragma: 'createElement'}]]
          }
        }
      }
    ]
  },
  devServer: {
    static: {
      directory: resolve(__dirname)
    }
  }
}